package doantotnghiep.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.NamedNativeQuery;

@Entity

@Table(name = "PhieuXuatHang")
public class ExportedMedicine {
   
	private int exportedID;
	private String exportededDate;

	private String deliveryLocation;

	@Id
	@GeneratedValue
	@Column(name="MaPXH")
	public int getexportedID() {
		return exportedID;
	}
	
	public void setexportedID(int exportedID) {
		this.exportedID = exportedID;
	}
	
	@Column(name ="NgayXuatHang")
	public String getexportededDate() {
		return exportededDate;
	}
	
	public void setexportededDate(String exportededDate) {
		this.exportededDate = exportededDate;
	}
	
	@Column(name="NoiGiaoHang")
	public String getDeliveryLocation() {
		return deliveryLocation;
	}
	
	public void setDeliveryLocation(String deliveryLocation) {
		this.deliveryLocation = deliveryLocation;
	}
	
	private Customer customer;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MaKH")
	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	private Staff staff;
	
	@ManyToOne
	@JoinColumn(name="MaNV")
	public Staff getStaff() {
		return staff;
	}

	public void setStaff(Staff staff) {
		this.staff = staff;
	}
	
	private Set<ExportedDetail> exportedDetails = new HashSet<ExportedDetail>();
	
	@OneToMany(mappedBy = "exportedMedicine", fetch = FetchType.LAZY) 
	public Set<ExportedDetail> getExportedDetails() {
		return exportedDetails;
	}	
	public void setExportedDetails(Set<ExportedDetail> purchaseexportedDetails) {
		this.exportedDetails = purchaseexportedDetails;
	}
	
}
